package com.fr.base.core.image4j.io;

public class EndianUtils
{
  public static short swapShort(short paramShort)
  {
    return (short)((paramShort & 0xFF00) >> 8 | (paramShort & 0xFF) << 8);
  }

  public static int swapInteger(int paramInt)
  {
    return ((paramInt & 0xFF000000) >> 24 | (paramInt & 0xFF0000) >> 8 | (paramInt & 0xFF00) << 8 | (paramInt & 0xFF) << 24);
  }

  public static long swapLong(long paramLong)
  {
    return ((paramLong & 0x0) >> 56 | (paramLong & 0x0) >> 40 | (paramLong & 0x0) >> 24 | (paramLong & 0x0) >> 8 | (paramLong & 0xFF000000) << 8 | (paramLong & 0xFF0000) << 24 | (paramLong & 0xFF00) << 40 | (paramLong & 0xFF) << 56);
  }

  public static float swapFloat(float paramFloat)
  {
    int i = Float.floatToIntBits(paramFloat);
    i = swapInteger(i);
    return Float.intBitsToFloat(i);
  }

  public static double swapDouble(double paramDouble)
  {
    long l = Double.doubleToLongBits(paramDouble);
    l = swapLong(l);
    return Double.longBitsToDouble(l);
  }
}